package com.csc.junit.data;

public class Employee {
	private String id;
	private String name;
	private String title;
	private double salary;
	private int yoe;
	private int cscPoint;
	
	public Employee() {
		System.out.println("Default Constructor in Employee is called");
	}
	
	public double getSalary() {
		calculateSalary();
		return salary;
	}
	
	private void calculateSalary() {
		
		if (title.equals("SE")) {
			if (yoe < 5) {
				salary = 400.0;
			} else {
				salary = 1000.0;
			}
		} else if (title.equals("TA")) {
			if (yoe < 10) {
				salary = 600.0;
			} else {
				salary = 1500.0;
			}
		} else {
			salary = 3000.0;
		}
		
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public Employee(String id, String name, String title) {
		System.out.println("Constructor 1 in Employee is called");
		this.id = id; 
		this.name = name;
		this.title = title;
	}
	
	public Employee(String id, String name, String title, int yoe) {
		System.out.println("Constructor 2 in Employee is called");
		this.id = id; 
		this.name = name;
		this.title = title;
		this.yoe = yoe;
	}
	
	public void setCscPoint() {
		if (title.equals("SE")) {
			if (yoe < 5) {
				cscPoint = 10;
			} else {
				cscPoint = 20;
			}
		} else if (title.equals("TA")) {
			if (yoe < 10) {
				cscPoint = 15;
			} else {
				cscPoint = 30;
			}
		} else {
			cscPoint = 50;
		}
	}
	
	public int getCscPoint() {
		return cscPoint;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
		
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
